<template>
	<view>
		<form @reset="formReset" @submit="formSubmit">
			<!--<tui-list-cell :hover="false">-->
				<!--&lt;!&ndash;<view class="tui-line-cell self-flex">&ndash;&gt;-->
					<!--&lt;!&ndash;<view class="tui-title self-flex-title">评论</view>&ndash;&gt;-->
					<!--&lt;!&ndash;<input class="tui-input self-flex-content" maxlength="50" name="age" placeholder="请输入评论" placeholder-class="phcolor"&ndash;&gt;-->
								 <!--&lt;!&ndash;type="number"/>&ndash;&gt;-->
				<!--&lt;!&ndash;</view>&ndash;&gt;-->
			<!--</tui-list-cell>-->
			<view class="cu-form-group align-start">
				<view class="title">评论</view>
				<textarea maxlength="-1" :disabled="modalName!=null" @input="textareaBInput" placeholder="多行文本输入框"></textarea>
			</view>
			<view class="tui-btn-box">
				<button class="btn-primary" formType="submit" hover-class="btn-hover" type="primary">Submit</button>
				<button class="btn-primary btn-gray" formType="reset" hover-class="btn-g ray-hover">Reset</button>
			</view>
		</form>

	</view>
</template>

<script>
  import {addEvaluate} from '@/api/user/index'
	export default {
		data() {
			return {
        evaluate: '',
				rid: ''

			}
		},
    onLoad(option) {
      // 获取订单号，
      this.rid = option.rid
      this.tui.toast(this.rid);

    },
		methods: {
      textareaBInput(e) {
        this.evaluate = e.detail.value
      },
      formSubmit(e) {
        addEvaluate(this.rid,this.evaluate).then(res=> {
          this.tui.toast("添加成功", 2000, true);
          uni.navigateTo({
            url: `/pages/user/userOrder`,
            animationType: 'pop-in',
            animationDuration: 300
          });
				})

			}

		}
	}
</script>

<style>

</style>
